home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-11 | 5.0 KB | 130 lines | [TEXT/MPS ] |
- MPW WINDOW BAR
- By Eric Traut
- Version 1.0ß3
-
-
- **** WHAT IS IT?
- Window Bar is a small utility which creates a customizable window
- bar in the MPW Shell’s windows. The bar contains button-like icons
- with associated scripts. When a button is pressed, an MPW script is
- executed.
-
-
- **** REQUIREMENTS
- You need a copy of the MPW Shell 3.3 or greater and a machine running
- System 7. You also need a copy of ResEdit to for installation.
-
-
- **** HOW TO INSTALL
- These instructions assume some knowledge of ResEdit and MPW.
-
- The window bar contains a number of components. The first and most
- important is a WDEF resource in the file MPWWindowBar.rsrc. Follow
- these steps to install the WDEF resource:
- 1. Save your original copy of the MPW Shell (just in case)
- 2. Open a copy of MPW Shell and the “MPWWindowBar.rsrc” file with ResEdit.
- 3. See if there is a WDEF 0 resource in your MPW Shell already. If
- you are using a utility such as PopupFuncs, there will be one
- present. If not, go to step 5.
- 4. Renumber the WDEF 0 to WDEF 1.
- 5. Copy the WDEF 0 resource from MPWWindowBar.rsrc and paste it into
- the shell.
- 6. Quit ResEdit, saving all changes.
-
- Warning: Do not paste this WDEF into other programs. It will cause
- unusual (and perhaps detramental) side-effects.
-
- The second part of the window bar is a “prefs” file. Copy the
- “WindowBar Icons” into your main MPW directory. It must remain
- named “WindowBar Icons” and it must be in the same directory
- as the MPW shell to work.
-
- Third, copy the file “UserStartup•WindowBar” and the directory
- “WindowBarScripts” to your MPW folder. These must also be in the
- same directory as the MPW Shell.
-
- Finally, copy the two MPW tools “InstallIcon” and “RemoveIcon”
- into the MPW Shell’s directory or the “Tool” subdirectory.
-
- The installation is now complete. Launch MPW to see the changes.
-
-
- **** HOW IT WORKS
- The Window Bar is a simple WDEF which overrides the standard system
- window definition proc (WDEF 0). It actually does very little itself.
- It simply draws the window bar and responds to clicks on window
- bar icons. For everything else, it calls the standard WDEF 0. If
- it finds a WDEF 1 installed in the MPW Shell, it calls through to
- that istead. This means that the Window Bar will work with other
- utilties that use a similar stategy such as PopupFuncs.
-
- The icons to be drawn are stored as 'cicn' resources in the file
- “WindowBar Icons”. If this file is not present or is unreadable,
- the window bar will not be installed.
-
- The “UserStartup•WindowBar” gives some examples of how to use
- the InstallIcon tool to install icons and their related scripts.
-
- When an icon button is pressed, the WDEF sends an AppleEvent to
- the MPW Shell to tell it to execute the associated script.
-
- All icons and related information are kept in memory after they are
- created with the InstallIcon tool.
-
- There is a runtime memory overhead of about 2K for the code and
- approximately 250 bytes for each icon plus the size of the 'cicn'
- resource and the length of the script’s text. Therefore, if you have the
- maximum number of icons installed (32) with an average length script
- attached to each, your available MPW heap space will decrease by
- about 15K.
-
-
- **** MODIFYING THE WINDOW BAR
- To modify the appearance or behavior of any of the icons, or to
- add additional icons, use the InstallIcon tool. You can also add
- additional icons to the “WindowBar Icons” file.
- When you install an icon, you specify the 'cicn' resource id and
- the script to be attached to the icon. You may optionally include
- a name for the icon which is handy if you want to remove the icon
- by name in the future. You may also optionally include a list
- of file suffixes to indicate which types of files the icon should
- work with. If you want the icon to only work with files ending
- in “.c”, for example, use the file type string "c". You may also
- enter a list of file suffixes, colon delimited and without spaces.
- For example, to specify assembly, C, C++, and pascal files,
- use the string "a:asm:c:cp:h:p". Note that these suffixes
- are case-insensitive, so the above example would work with
- “Foo.C” as well as “Foo.c”.
-
-
- **** DISCLAIMER
- This is a beta version. I would appreciate bug reports. I have
- tested it using MPW 3.3 on a Quadra 700 with multiple monitors.
- It seems to work fine with this set-up, and I know of no reasons
- why it shouldn’t work on any machine running System 7. I have not
- stress-tested it yet under low-mem conditions, so be careful
- there. The author is not responsible for lost data due to crashes
- or normal use of this piece of software. Use it at your own risk.
-
-
- **** CHANGE HISTORY
- version ß1:
- This version was slow and very buggy. It was written quickly in a
- single night, and it showed.
-
- version ß2:
- Incorporated many suggestions from friends and coworkers including
- using AppleEvents to communicate with MPW.
-
- version ß3:
- Finished dynamic version of WindowBar including the InstallIcon and
- RemoveIcon tools.
-
- version ß4:
- Fixed two bugs: zoom boxes now work as they should (they didn’t show
- up at all in previous versions), and the RemoveIcon tool doesn’t
- continually crash now.
-
-
-
-